import {openModal} from "../../../utils";
import FlowUserTaskHistory from "../nodeHistoryDetail/FlowUserTaskHistory";
import FlowModelInstance from "../typs/FlowModelInstance";

export class ShowFlowUserTaskHistory {
  nodeId;
  supportInstance;

  constructor(supportInstance, nodeId) {
    this.supportInstance = supportInstance;
    this.nodeId = nodeId;
  }

  serve() {
    openModal(FlowUserTaskHistory, {
      taskId: this.nodeId,
      service: this.supportInstance.service,
      processInstanceId: this.supportInstance.processInstanceId,
      userTask: new FlowModelInstance(this.supportInstance.getModel()).getNodeById(this.nodeId)
    })
  }
}
